home *** CD-ROM | disk | FTP | other *** search
- Path: Gamma.RU!srcc!newsserver
- Newsgroups: comp.lang.c++
- References: <Dn65GG.M19@twisto.eng.hou.compaq.com>
- Message-ID: <AB9m_CnaPA@r-style.msk.su>
- Organization: JV R-Style
- Date: Wed, 28 Feb 1996 09:54:01 +0300 (MSK)
- From: "Alex Lubimov" <lubimov@r-style.msk.su>
- X-Mailer: dMail [Demos Mail for DOS v1.23]
- Subject: Re: BC++. Pls help me with precompiled headers...
- Distribution: su
- Sender: news-service@srcc.msu.su
- X-Return-Path: gamma!rstyle!r-style.msk.su!lubimov
-
- <jhenell@bangate.eur.compaq.com> wrote:
-
- >When compiling I get the following error message:
- >"Warning LEATHER.CPP 47: Cannot create pre-compiled header: code in
- >header"
- >(the 47th line is the constructor of one of the classes,
- >"Leather::Leather() (" )
-
- This message occurs when you place non-inline code in your header
- file, i.e. something like this:
-
- /******************************/
- class A
- {
- protected:
- int x;
- public:
- A ( int n = 0 );
- };
-
- A::A ( int n ) { x = n; }
- /*******************************/
-
- The code for constructor will:
- a) not be expanded inline
- b) will be placed in each module where you include this
- header file.
-
- To correct the problem you will want to do any of the following:
-
- 1. place all function definitions in .CPP file
-
- 2. declare function to be 'inline' (in this case function
- definition should reside in .H or .HPP file):
-
- inline A::A ( int n ) { x = n; }
-
-
- Hope this helps...
-
-
- Yours,
- Alex
-
-
-